#include<iostream>
#include<fstream>
#include<sstream>
#include<limits>
#include<string.h>
using std::endl;
using std::cout;
using std::cin;
using std::string;
int main(void)
{
    //std::ios::ate
    std::ifstream ofs("readfile.cc");
    if(!ofs)
    {
        cout<<"打开文件失败"<<endl;
        exit(1);
    }

    ofs.seekg(0,std::ios::end);
    off_t site=ofs.tellg();

    char * arr=new char[site+1]();
    ofs.seekg(0,std::ios::beg);

    ofs.read(arr,site+1);
    delete []arr;
    arr=nullptr;
    cout<<arr<<endl;
    ofs.close();
}


